﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using GameLibrary.Settlement;

namespace UserInterface.Helpers
{
    public class SettlementInfomation
    {
        public string ID { get; private set; }
        public string Type { get; private set; }
        public string Income { get; private set; }
        public string Output { get; private set; }
        public string Road_Level { get; private set; }
        public string Plant_Level { get; private set; }
        public string Factory_Level { get; private set; }
        public string Villages { get; private set; }

        public SettlementInfomation(SettlementInfo info)
        {
            this.ID = info.ID.ToString();
            this.Type = info.Type.ToString();
            this.Income = info.Income.ToString();
            this.Output = info.Production.ToString();
            this.Road_Level = info.Buildings[SettlementHelper.Road].ToString();

            if (info.Buildings.ContainsKey(SettlementHelper.Plant) == true)
                this.Plant_Level = info.Buildings[SettlementHelper.Plant].ToString();
            else
                this.Plant_Level = string.Empty;

            if (info.Buildings.ContainsKey(SettlementHelper.Factory) == true)
                this.Factory_Level = info.Buildings[SettlementHelper.Factory].ToString();
            else
                this.Factory_Level = string.Empty;

            if (info.villages != null)
                this.Villages = info.villages.Count.ToString();
            else
                this.Villages = "0";
        }
    }
}
